﻿using System.Collections.Generic;
using System.Linq;

namespace ExercisesResolution.Models
{
    public class ImageRepository
    {
        private IList<License> _licenses;

        public ImageRepository()
        {
            _licenses = new List<License>();
            _licenses.Add(new License { Id = 1,
                Name = "All Right Reserved" });
            _licenses.Add(new License { Id = 2,
                Name = "Attribution CC" });
            _licenses.Add(new License { Id = 3,
                Name = "Attribution-ShareAlike CC" });
            _licenses.Add(new License { Id = 4,
                Name = "Attribution-NonCommercial CC" });
        }

        public IList<License> GetLicenseList()
        {

            return _licenses;
        }

		//Added for exercise 4
        public License GetLicenseById(int id)
        {
            return _licenses.Where(l => l.Id == id).Single();
        }

    }
}

